﻿#ifndef ConstantBufferCollection_h
#define ConstantBufferCollection_h

#include <Defines.h>
#include <CSharpPropertyMethods.h>

// Riccsson includes.
#include <System/Object.h>
#include <System/Array.h>

// XNA includes.
#include "ShaderStage.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Graphics
			{
				// Forward declerations.
				class ConstantBuffer;
				class GraphicsDevice;

				/*internal*/ class ConstantBufferCollection sealed
				{
					private: /*readonly*/ GC_PTR<Riccsson::System::Array<GC_PTR<ConstantBuffer>>> _buffers;

					private: ShaderStage _stage;

					private: int _valid;

					public: /*internal*/ ConstantBufferCollection(ShaderStage stage, int maxBuffers);

					// TODO: Insert a GET SET Method instead.
					//public: ConstantBuffer this[int index];

					public: /*internal*/ void Clear();

			#if DIRECTX
					public: /*internal*/ void SetConstantBuffers(GraphicsDevice device);
			#elif OPENGL || PSM
					public: /*internal*/ void SetConstantBuffers(GraphicsDevice device, int shaderProgram);
			#else
					public: /*internal*/ void SetConstantBuffers(GC_PTR<GraphicsDevice> device, int shaderProgram);
			#endif
					
				};
			}
		}
	}
}

#endif